package cn.wangsy.zhidao.p20170328;

class Circle{

	final double PI = 3.14f;

	double radius;

	Circle(){
		radius = 0;
	}

	Circle(double r){
		radius = r;
	}

	double getRadius(){// 获得半径
		return radius;
	}

	double getPerimeter(){// 获得周长
		return 2 * PI * radius;
	}

	double getArea(){
		return radius * radius * PI;
	}

	void show(double r, double p, double a){
		System.out.println("半径：" + r + "周长：" + p + "面积：" + a);
	}

}

public class Test1 {

	public static void main(String args[]){
		
		//Circle r1 = new Circle();
		//r1.Circle(3.4);// 为什么这句话有错
		Circle r1 = new Circle(3.4);
		r1.show(r1.getRadius(), r1.getPerimeter(), r1.getArea());
		
	}

}